<?php
header("content-type:text/html;charset=utf8");
/**
*
* example目录下为简单的支付样例，仅能用于搭建快速体验微信支付使用
* 样例的作用仅限于指导如何使用sdk，在安全上面仅做了简单处理， 复制使用样例代码时请慎重
* 请勿直接直接使用样例对外提供服务
*
**/
require_once "/weixin/lib/WxPay.Api.php";
require_once "/weixin/example/WxPay.JsApiPay.php";
require_once "/weixin/example/WxPay.Config.php";
require_once '/weixin/example/log.php';

//初始化日志
$logHandler= new CLogFileHandler("../logs/".date('Y-m-d').'.log');
$log = Log::Init($logHandler, 15);


$tools = new JsApiPay();
$openId = Cookie('openId',$tools->GetOpenid());
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>首页</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="__PUBLIC__/css/mui.min.css">
		<link rel="stylesheet" href="__PUBLIC__/css/index.css">
		<style>
			.nav div:nth-child(1) i{
				background: url(__PUBLIC__/images/bizimg/icon1.png) no-repeat;
				background-size: 100%;
				display: block;
			}
			.nav div:nth-child(2) i{
				background: url(__PUBLIC__/images/bizimg/icon2.png) no-repeat;
				background-size: 100%;
				display: block;
			}
			.nav div:nth-child(3) i{
				background: url(__PUBLIC__/images/bizimg/icon3.png) no-repeat;
				background-size: 100%;
				display: block;
			}
			.nav div:nth-child(4) i{
				background: url(__PUBLIC__/images/bizimg/icon4.png) no-repeat;
				background-size: 100%;
				display: block;
			}
			.index-set{
				width: 30px;
				height: 30px;
				background: url(__PUBLIC__/images/bizimg/set.png);
				background-size: 100%;
				position: absolute;
				right: -10px;
			}
			.index-btn{
				width: 100px;
				height: 100px;
				margin: 0 auto;
				background: url(__PUBLIC__/images/bizimg/btn.png);
				background-size: 100%;
			}

		</style>
		<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<h1 class="mui-title">百福云仓</h1>
		</header>
		<div class="mui-content ">
			<p class="rukou">请选择您的角色入口</p>
			<div class="nav">
				<div href="{:U('Time/index')}" class="p">
					<i></i>
					<p>计时租赁</p>
					<em class="index-set"></em>
				</div>
				<div href="{:U('Storehouse/index')}" class="p">
					<i></i>
					<p>有仓分享</p>
					<em></em>
				</div>
				<!--
				<div class="p">
					<i></i>
					<p>内部操作</p>
					<em></em>
				</div>
				<div class="p">
					<i></i>
					<p>企业仓</p>
					<em></em>
				</div>
				!-->
			</div>
			<div href="{:U('Time/index')}" class="index-btn"></div>
		</div>
	</body>
</html>
<script>
	$('.p').click(function()
	{
	    var obj = $(this)
        $.each($('.p'),function(i,j){
            //i为元素的索引，从0开始,j为当前处理的元素对象
            $(this).find("em").attr('class','')
        });
	    //添加class
        obj.find("em").attr('class','index-set')
		//获取url
		var url = $(this).attr('href')
		if(url)
		{
            $('.index-btn').attr('href',url)
		}
        else
		{
            $('.index-btn').attr('href','')
		}
	})
	//点击按钮跳转
	$('.index-btn').click(function () {
		var url = $(this).attr('href')
		// alert(url)
		//return false
		if(url == 'undefined')
		{
		    return false
		}
		location.href=url
    })
</script>